/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.cms.dyn.mapper;

import com.jeeplus.core.persistence.BaseMapper;
import com.jeeplus.modules.cms.dyn.entity.CmsContentsDyn;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

/**
 * 动态内容MAPPER接口
 *
 * @author Sawyer
 * @version 2020-11-26
 */
@Mapper
@Repository
public interface CmsContentsDynMapper extends BaseMapper<CmsContentsDyn> {

    /**
     * 点击数+1
     *
     * @param id id
     * @return 受影响记录数
     */
    int updateHitsAddOne(String id);

    /**
     * 更新过期权重
     *
     * @param cmsContentsDyn 内容
     * @return 受影响记录数
     */
    int updateExpiredWeight(CmsContentsDyn cmsContentsDyn);

    /**
     * 根据siteId获取总点击数
     *
     * @param siteId 站点id
     * @return 总点击数
     */
    Integer getTotalHitsBySiteId(String siteId);
}
